package com.gitee.mapper;

import com.gitee.annotation.AutoFill;
import com.gitee.entity.Comment;
import com.gitee.enumeration.OperationType;
import com.gitee.vo.CommentVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Delete;
import java.util.List;

@Mapper
public interface CommentMapper {

    @AutoFill(OperationType.INSERT)
    @Insert("insert into sxq_comment values(null, #{comment}, #{userId}, #{friendUpdatesId}, #{createTime})")
    void insert(Comment comment);

    List<CommentVO> selectByFriendUpdateId(Integer friendUpdatesId);

    @Delete("delete from sxq_comment where friend_updates_id = #{friendUpdateId}")
    void deleteByFriendUpdatesId(Integer friendUpdateId);
}
